package cn.ad.server.web.filter.bid;

import cn.ad.server.web.spring.service.actions.context.BidContext;
import cn.ad.server.domain.ad.Strategy;

/**
 * @author dongbin.yu
 * @from 2016-07-19
 * @since V1.0
 */
public class TimeRangeMatcher implements BidMatcherChain {

    @Override
    public boolean match(Strategy strategy, BidContext context) {

        long time = System.currentTimeMillis();
        long startTime = strategy.getStartTime().getTime();
        long endTime = strategy.getEndTime().getTime();

        return time >= startTime && time <= endTime;
    }
}
